// 封装所有的接口请求
import $ajax from './ajax'

/** 请求一级分类 */
export let getTypeOne = async () => $ajax('/getTypeOne')


/** 请求轮播图 */
export let getBanner = async () => $ajax('/banner')

/** 请求商品列表 */
export const getGoodList = async (params) => $ajax('/goodList', params)

/** 登录 */
export const loginIn = async (params) => $ajax('/login', params)

/** 注册 */
export const register = async (params) => $ajax('/register', params)

/**请求详情 */
export const getDetail = async (params) => $ajax('/detail', params)
/**请求同店商品 */
export const getSame = async (params) => $ajax('/sameList', params)

/** 添加购物车商品【增加商铺数量】 */
export const postAdd = async (params) => $ajax('/add', params)

/** 购物车商品列表 */
export const getCarts = async (params) => $ajax('/shopList', params)

/** 删除 购物车商品 */
export const postDel = async (params) => $ajax('/del', params)

/** 添加购物车 */
export const postSub = async (params) => $ajax('/remove', params)

/** 搜索接口 /search */

export const getSearch = async (params) => $ajax('/search', params)